<?php
class OrderController extends Controller
{
	public $layout='//layouts/column2';
	public function actionDetail($orderid){
		$order = Order::model()->findByPk($orderid);
		$this->render('detail',array('order'=>$order));
	}
	
	public function actionDo($orderid){
		$this->render('do',array('orderid'=>$orderid));
	}
	
	public function actionCancel($orderid){
		$order = Order::model()->findByPk($orderid);
		if($order){
			$order->status = Order::CANCEL;
			$flag = $order->update(array('status'));
			Utils::ajaxReturn("",$flag);
		}else{
			Utils::ajaxReturn('订单不存在',false);
		}
	}
}